package com.itqf.hsh.controller;

import com.itqf.hsh.dto.pro;
import com.itqf.hsh.pojo.Provider;
import com.itqf.hsh.service.ProviderService;
import com.itqf.hsh.service.UserService;
import com.itqf.hsh.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * projectName: qk_javaproject
 *
 * @author: 肖成扬
 * time: 2021/9/8 14:52
 * description:
 */
@RestController
@CrossOrigin("*")
@RequestMapping("/provider")
public class ProviderController {
    @Autowired
    private ProviderService providerService;
    @GetMapping("providers")
    public Object providers(){
        R r=providerService.providers();
        return r;
    }
    @GetMapping("list")
    public Object list(pro Pro){
        R r =providerService.list(Pro);
        return r;
    }
    @PostMapping("save")
    public Object save(@RequestBody Provider provider){
        R r=providerService.save(provider);
        return r;
    }
    @GetMapping("delete")
    public Object delete(int pid){
        R r = providerService.removeUserById(pid);
        return r;
    }

    @PostMapping("update")
    public Object update(@RequestBody Provider provider){
        R r=providerService.updateUser(provider);
        return r;
    }
//
//    @PostMapping("update")
//    public Object update(@RequestBody Bill bill){
//        R r=billService.update(bill);
//        return  r;
//    }
//    @PostMapping("delete")
//    public Object show(int bid){
//        R r=billService.delete(bid);
//        return r;
//    }
}
